<!--  -->
<template>
  <div>
    <van-nav-bar
      fixed placeholder
      title="拼团中"
      left-arrow
    />
    <div class="box">
      <div v-if="status=='pendding'">
        <div class="time">剩余<van-count-down :time="time" class="bold"/>结束</div>
        <!-- 成员 -->
        <div class="member">
          <div class="first">
            <van-image
              round
              width="50"
              height="50"
              src="https://img01.yzcdn.cn/vant/cat.jpeg"
            />
            <div class="tuanzhang orange">团长</div>
          </div>
          <div class="second">
            ?
          </div>
        </div>
        <div class="bold orangetext">拼团中，还差1人拼团成功</div>
        <div>
          <van-button color="#FF6633" @click="applyFirend">邀请好友拼单</van-button>
          <van-button color="#FF6633" plain>返回首页</van-button>
        </div>
        <div>分享好友越多，成团越快</div>
      </div>
      <div v-else-if="status=='success'">
        <div class="member">
          <div class="first">
            <van-image
              round
              width="50"
              height="50"
              src="https://img01.yzcdn.cn/vant/cat.jpeg"
            />
            <div class="tuanzhang purple">团长</div>
          </div>
          <div class="second">
            <van-image
              round
              width="50"
              height="50"
              src="https://img01.yzcdn.cn/vant/cat.jpeg"
            />
          </div>
        </div>
        <div class="bold purpletext"><van-icon name="passed" size="24"/>拼团成功，我们会尽快为您发货</div>
        <div>
          <van-button color="#9999FF" @click="applyFirend">查看订单</van-button>
          <van-button color="#9999FF" plain>返回首页</van-button>
        </div>
      </div>
      <div v-else>
        <div class="member">
          <div class="first">
            <van-image
              round
              width="50"
              height="50"
              src="https://img01.yzcdn.cn/vant/cat.jpeg"
            />
            <div class="tuanzhang yellow">团长</div>
          </div>
          <div class="second">
            ?
          </div>
        </div>
        <div class="bold yellowtext"><van-icon name="close" size="24"/>拼团失败,原路退还您的金额</div>
        <div>
          <van-button color="#FFC80D" @click="applyFirend">查看订单</van-button>
          <van-button color="#FFC80D" plain>返回首页</van-button>
        </div>
      </div>
      <div class="tuijian">
        <h4>好物拼团推荐</h4>
          <template v-for="v in adviceListArr">
            <van-card
                :tag="v.tag"
                :price="v.price"
                :desc="v.desc"
                :title="v.title"
                :thumb="v.thumb"
                :origin-price="v.origin_price"
                :key="v.title"
            >
                <template #num>
                    <van-image
                            round
                            width="2rem"
                            height="2rem"
                            src="https://img01.yzcdn.cn/vant/cat.jpeg"
                    />
                    <van-image
                            round
                            width="2rem"
                            height="2rem"
                            src="https://img01.yzcdn.cn/vant/cat.jpeg"
                    />
                </template>
            </van-card>
      </template>
      </div>
    </div>
    
  </div>
</template>

<script>
export default {
  name:'pintuanStatus',
  data () {
    return {
      time: 30 * 60 * 60 * 1000,
      status:'fail',
      adviceListArr:[
        {
            tag:"3人团",
            price:"2.00",
            desc:"已拼536件",
            title:"商品标题",
            thumb:"https://img01.yzcdn.cn/vant/ipad.jpeg",
            origin_price:"10.00",
        },
        {
            tag:"3人团",
            price:"2.00",
            desc:"已拼536件",
            title:"商品标题",
            thumb:"https://img01.yzcdn.cn/vant/ipad.jpeg",
            origin_price:"10.00",
        },
        {
            tag:"3人团",
            price:"2.00",
            desc:"已拼536件",
            title:"商品标题",
            thumb:"https://img01.yzcdn.cn/vant/ipad.jpeg",
            origin_price:"10.00",
        },
        {
            tag:"3人团",
            price:"2.00",
            desc:"已拼536件",
            title:"商品标题",
            thumb:"https://img01.yzcdn.cn/vant/ipad.jpeg",
            origin_price:"10.00",
        }
      ],
    }
  },
  methods:{
    applyFirend(){
      this.$toast.success('邀请好友成功');
    }
  }
}
</script>

<style  scoped>
.box{
  background-color: #fcfcfce1;
}
.box>div{
  margin-bottom: 10px;
  border-radius: 30px;
  padding: 20px 10px;
  background-color: white;
}
.van-icon{
  vertical-align: middle;
  padding-right: 10px;
}
  .van-count-down{
    display: inline-block
  }
  .time{
    padding: 20px 0;
    color: #CCCCCC;
  }
  .member{
    display: flex;
    justify-content: center;
    margin: 20px 0;
  }
  .member>div{
    margin-right: 30px;
  }
  .first{
    position: relative;
  }
  .orange{
    background-color: #FF6633;
  }
  .purple{
    background-color: #9999FF;
  }
  .purpletext{
    color: #9999FF;
  }
  .orangetext{
    color: #FF6633;
  }
  .yellowtext{
    color:#FFC80D ;
  }
  .yellow{
    background-color: #FFC80D;
  }
  .tuanzhang{
    position: absolute;
    top: -4px;
    left: 33px;
    color: white;
    
    width: 40px;
    padding: 0 5px;
    font-size: 12px;
    z-index: 1;
    border-radius: 10px;
  }
  .second{
    width: 50px;
    height: 50px;
    line-height: 50px;
    border-radius: 50px;
    border: 2px dashed #CCCCCC;
    font-weight: 600;
    color: #CCCCCC;
  }
  .van-button {
    margin: 20px 10px 20px 10px;
  }
  .bold{
    font-size: 18px;
    font-weight: 600;
    padding: 0 10px;
  }
  .tuijian{
    text-align: left;
  }
  .tuijian .van-image{
    margin-right: -5px;
  }
  h4{
    text-align: left;
    padding: 10px;
  }
</style>
